:root {
    --primary-color: #0078D4;  /* Microsoft Blue */
    --secondary-color: #106EBE;
    --background-color: #F5F5F5;
    --surface-color: #FFFFFF;
    --text-primary: #323130;
    --text-secondary: #605E5C;
    --border-color: #EDEBE9;
    --hover-color: #F3F2F1;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease-in-out;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--surface-color);
    box-shadow: var(--shadow);
    border-radius: 4px;
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    font-size: 1.75rem;
}

nav {
    display: flex;
    gap: 1rem;
}

nav a {
    text-decoration: none;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 2px;
    transition: var(--transition);
    font-weight: 500;
}

nav a:hover {
    background-color: var(--hover-color);
}

nav a.active {
    background-color: var(--primary-color);
    color: white;
}

/* 表单样式 */
.software-form {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* 统一所有输入框样式 */
.form-control,
input[type="text"],
input[type="password"],
input[type="file"],
textarea {
    width: 100%;
    padding: 0.75rem;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: inherit;
    background-color: white;
    transition: all 0.2s ease-in-out;
}

/* 输入框获得焦点时的样式 */
.form-control:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 2px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

button:hover {
    background-color: var(--secondary-color);
}

/* 表格样式 */
.software-list {
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--surface-color);
}

th {
    text-align: left;
    padding: 1rem;
    background-color: var(--hover-color);
    color: var(--text-secondary);
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: normal;
    word-break: break-word;
}

/* 警告框样式 */
.alert {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translate(-50%, -20px);
    padding: 1.5rem 2rem;
    border-radius: 4px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 400px;
    max-width: 80%;
    text-align: left;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
}

.alert.show {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.alert-success {
    background-color: #DFF6DD;
    color: #107C10;
    border: 1px solid #C6F0C2;
}

.alert-error {
    background-color: #FDE7E9;
    color: #A4262C;
    border: 1px solid #F1707B;
}

/* 成功提示框的特殊样式 */
.alert.alert-success {
    background-color: #DFF6DD;
    color: #107C10;
    border: 1px solid #C6F0C2;
}

.alert.alert-success strong {
    color: #0B5C0B;
}

/* 倒计时样式 */
#countdown {
    font-weight: bold;
    color: #0B5C0B;
    display: inline-block;
    min-width: 1.5em;
    text-align: center;
}

/* 进度条样式 */
progress {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

progress::-webkit-progress-bar {
    background-color: var(--border-color);
}

progress::-webkit-progress-value {
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

/* 动画 */
@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 0;
        padding: 1rem;
        border-radius: 0;
    }

    .nav-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    nav {
        width: 100%;
        justify-content: space-between;
    }
}

/* 添加编辑面板样式 */
.edit-panel {
    position: fixed;
    top: 0;
    right: -400px; /* 初始位置在屏幕外 */
    width: 400px;
    height: 100vh;
    background-color: var(--surface-color);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
}

.edit-panel.active {
    right: 0;
}

.edit-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.edit-panel-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.5rem;
    transition: color 0.2s;
}

.close-button:hover {
    color: var(--text-primary);
}

.edit-panel .form-group {
    margin-bottom: 1.5rem;
}

.edit-panel-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.edit-panel-buttons button {
    min-width: 100px;
}

.edit-panel-buttons button.secondary {
    background-color: var(--hover-color);
    color: var(--text-primary);
}

.edit-panel-buttons button.secondary:hover {
    background-color: var(--border-color);
}

/* 添加遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 添加静态文本样式 */
.static-text {
    padding: 0.75rem;
    background-color: var(--hover-color);
    border-radius: 2px;
    color: var(--text-secondary);
}

/* 调整表格列宽 */
table th:nth-child(1) { width: 20%; } /* 软件名称 */
table th:nth-child(2) { width: 15%; } /* 版本号 */
table th:nth-child(3) { width: 30%; } /* 描述 */
table th:nth-child(4) { width: 20%; } /* 上传时间 */
table th:nth-child(5) { width: 15%; } /* 操作 */

/* 让表格内容换行 */
td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: normal;
    word-break: break-word;
}

/* 操作按钮容器 */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    white-space: nowrap;
}

/* 操作按钮样式 */
.action-buttons button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-width: 60px;
}

.action-buttons button.edit {
    background-color: var(--primary-color);
}

.action-buttons button.delete {
    background-color: #d83b01; /* Microsoft 红色 */
}

.action-buttons button.delete:hover {
    background-color: #a42e01;
}

/* 用户管理页面样式 */
.users-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
}

/* 用户表格列宽调整 */
.users-section table th:nth-child(1) { width: 25%; } /* 用户名 */
.users-section table th:nth-child(2) { width: 20%; } /* 角色 */
.users-section table th:nth-child(3) { width: 35%; } /* 创建时间 */
.users-section table th:nth-child(4) { width: 20%; } /* 操作 */

select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    transition: var(--transition);
    font-family: inherit;
    background-color: white;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);
}

/* 授权按钮样式 */
.action-buttons button.authorize {
    background-color: #107C10; /* Microsoft 绿色 */
}

.action-buttons button.authorize:hover {
    background-color: #0B5C0B;
}

/* 用户列表样式 */
.user-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 0.5rem;
}

.user-item {
    padding: 0.5rem;
    transition: background-color 0.2s;
}

.user-item:hover {
    background-color: var(--hover-color);
}

.user-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.user-item input[type="checkbox"] {
    margin: 0;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0078D4 0%, #106EBE 100%);
    padding: 1rem;
}

.login-box {
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-color);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-form .form-group {
    position: relative;
    margin-bottom: 0;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 登录表单输入框样式 */
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: inherit;
    background-color: white;
    transition: all 0.2s ease-in-out;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);
}

/* 登录按钮样式 */
.login-form button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin-top: 1rem;
}

.login-form button[type="submit"]:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.15);
}

/* 登录页面的警告框样式 */
.login-container .alert {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 300px;
    text-align: center;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .login-box {
        padding: 2rem;
        margin: 1rem;
    }

    .login-box h1 {
        font-size: 1.5rem;
    }

    .login-container .alert {
        width: 90%;
        min-width: auto;
    }
}

/* 添加动画效果 */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box {
    animation: slideUp 0.5s ease-out;
}

.login-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: -1rem 0 1.5rem;
    padding: 0;
}

/* 成功面板样式 */
.success-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    width: 90%;
    max-width: 500px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
}

.success-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

.success-panel-content {
    text-align: center;
}

.success-icon {
    font-size: 3rem;
    color: #107C10;
    margin-bottom: 1rem;
}

.success-panel h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin: 0 0 1.5rem;
}

.software-info {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-align: left;
}

.info-item {
    display: flex;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item label {
    color: var(--text-secondary);
    min-width: 100px;
    margin-bottom: 0;
}

.info-item span {
    color: var(--text-primary);
    word-break: break-all;
}

.success-panel button {
    min-width: 120px;
    margin-top: 1rem;
}

.success-panel button.primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.success-panel button.primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.15);
}

/* 添加面板显示/隐藏动画 */
@keyframes panelIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.success-panel.active {
    animation: panelIn 0.3s ease-out forwards;
}

/* 模态框容器 */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-container .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.modal-container .overlay.active {
    opacity: 1;
}

.modal-container .success-panel {
    position: relative;
    z-index: 1001;
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-out;
}

.modal-container .success-panel.active {
    opacity: 1;
    transform: translateY(0);
}

/* 编辑面板中的输入框样式 */
.edit-panel .form-control,
.edit-panel input[type="text"],
.edit-panel input[type="password"],
.edit-panel textarea {
    width: 100%;
    padding: 0.75rem;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

/* 软件表单中的输入框样式 */
.software-form .form-control,
.software-form input[type="text"],
.software-form input[type="file"],
.software-form textarea {
    width: 100%;
    padding: 0.75rem;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
} 